package dao.truth;

import vo.TruthVO;

import com.ibatis.sqlmap.client.SqlMapClient;

public class TruthDAOImpl implements TruthDAO{

	private SqlMapClient sqlMapClient;

	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}

	@Override
	public int getTruth(int review_no) throws Exception {
		return (Integer) sqlMapClient.queryForObject("truth.getTruth", review_no);
	}

	@Override
	public int getFalsehood(int review_no) throws Exception {
		return (Integer) sqlMapClient.queryForObject("truth.getFalsehood", review_no);
	}

	@Override
	public void voteTruth(TruthVO param) throws Exception {
		sqlMapClient.insert("truth.voteTruth", param);
	}

	@Override
	public int didVoteTruth(TruthVO param) throws Exception {
		return (Integer) sqlMapClient.queryForObject("truth.didVoteTruth", param);
	}
	
	
}
